home *** CD-ROM | disk | FTP | other *** search
/ Power Utilities / Power Utilities.iso / utility / pro126 / convolve.doc < prev    next >
Encoding:
Text File  |  1991-03-24  |  20.4 KB  |  388 lines

  1.   ▒▒▒ ▒  ▒ ▒▒   ▒▒▒▒ ▒▒▒▒ ▒▒ ▒▒ ▒▒▒   ▒▒▒▒  ▒▒▒ ▒▒▒  ▒▒▒  ▒    ▒▒▒ ▒▒▒     ▒▒
  2.    ▒  ▒▒▒▒ ▒■   ▒  ▄ ▒▄▄▒ ▒ ▒ ▒ ▒■    ▒▄▄▄▒ ▒■  ▒  ▒ ▒  ▒ ▒    ▒■  ▒▄▄▒    ▒▒
  3.    ▒  ▒  ▒ ▒▒   ▒▒▒▒ ▒  ▒ ▒   ▒ ▒▒▒   ▒     ▒▒▒ ▒▒▒  ▒▒▒  ▒▒▒  ▒▒▒ ▒   ▒   ▄▄
  4.  
  5.  
  6.                           C O N V O L V E  v1.2  (c)1991.
  7.                                  by John Sirabella
  8.  
  9.    Synopsis:  This program performs image processing on a 320x200x256 image.
  10.               This image can be grayscales or color.  A 3x3 High-pass, Low-
  11.               pass, Gradient or Laplacin filter is passed over the image
  12.               to bring out specific features or edges in the image.  User
  13.               can create there own filters since they are just text files.
  14.               Resultant images created by program can optionally be saved to
  15.               a .PCX file.  Each resultant image can be scaled down for
  16.               desired effect according to needs.
  17.  
  18. Requirements: VGA Graphics is required and DOS 3.x or better.  Program will
  19.               run on any IBM PC/XT/AT or compatible system.  A 286 AT or
  20.               better is preferable.  The reason we created this program for
  21.               VGA Graphics only is because many grayscales and/or colors are
  22.               needed to produces reasonable results.  One cannot perform
  23.               any image processing with only 16 colors so we selected the
  24.               VGA mode 13H that supports 256 simultaneous colors.
  25.  
  26.  Experience:  This program was designed for the beginner in mind.  It
  27.               will illustrate the process of convolution and give you a
  28.               working program and some images to play with.
  29.  
  30. The Program:  The Program was written with Quick C v2.5 and "portions of the
  31.               code copyright Genus Microprogramming, Inc. 1988-1990".  The
  32.               C Source Code is not available.
  33.  
  34. Distribution: This program is FULLY FUNCTIONAL shareware and may be
  35.               distributed freely.  You may not charge more than $5.00 for the
  36.               distribution of this program.
  37.  
  38.  Legalities : All versions of this program are protected under copyright
  39.               law.  You may not modify, reverse engineer or change this
  40.               program in anyway.
  41.  
  42. Cost of       I am asking a $15.00 contribution for this program.  Your
  43. Program:      payment will allow for future enhancement and continued
  44.               development.  When you register, you will be entitled to the
  45.               next release of this program when it becomes available.  Refer
  46.               to the end of this documentation file for registration form.
  47.  
  48. Program       You can call our bbs and leave a message for the sysop if you
  49. Support:      need program support.  In addition you will find a great bbs!
  50.  
  51.  
  52.   ─╥─ ╖ ╓ ╥─╖  ╓─╖ ╓─╖ ╓─╥─╖ ╥─╖  ╥─╖ ╥─╖ ╥─╖ ╥─╖ ╖   ╥─╖ ╥─╖  ╥─╖ ╥─╖ ╓─╖
  53.    ║  ╟─╢ ╟─   ║ ╥ ╟─╢ ║ ║ ║ ╟─   ╟─╜ ╟─  ║ ║ ║ ║ ║   ╟─  ╟┬╜  ╟─╢ ╟─╢ ╙─╖
  54.    ╨  ╜ ╙ ╨─╜  ╙─╜ ╜ ╙ ╨   ╨ ╨─╜  ╨   ╨─╜ ╨─╜ ╨─╜ ╙─╜ ╨─╜ ╨ \  ╨─╜ ╨─╜ ╙─╜
  55.  Call Our BBS and Choose from a Wide Selection of Files, Doors and Bulletins.
  56.   Call 24 Hours a day, 7 days a week.  Discover The Game Peddler BBS Today!
  57.  
  58.            ┌─────────────────────┐
  59.            │ ┌─────────────────┐ │
  60.            │ │SOFTWARE         │ │                  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  61.            │ │  RELAYNET       │ │                  ▒▒ ╔═════════════════╗ ▒▒
  62.            │ │    BULLETINS    │ │                  ▒▒ ║ HAYES   ▀ ▀ ▀ ▀ ║ ▒▒
  63.            │ │       PRIZES    │ │                  ▒▒▄║ 516-493-0186    ║ ▒▒
  64.            │ │          DOORS  │ │                ▄▀▒▒ ╚══╦════════════╦═╝ ▒▒
  65.            │ │             ADS │ │               ▀▄ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  66.            │ └─────────────────┘ │              █▀  ▒▒ ╔═════════════════╗ ▒▒
  67.            └───▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄──┘             ▀▄   ▒▒ ║ U S R   ▀ ▀ ▀ ▀ ║ ▒▒
  68. ┌─────────────▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀─────────────┐ ▄▀   ▒▒▄║ 516-493-0785    ║ ▒▒
  69. │  ┌────┐ ┌───────────────────┐  ┌────────┐  │▀   ▄▀▒▒ ╚══╦═══════════╦══╝ ▒▒
  70. │  │ AT │ │ ° ▄ ▄  386/20MHZ  │  │ ─┬──── │  │ ▄▀▀  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  71. │  └────┘ └───────────────────┘  │────────│  │▀     ▒▒ ╔═════════════════╗ ▒▒
  72. │  ════════════════════════════  │. 1 GB  │  │▄     ▒▒ ║ GVC2400 ▀ ▀ ▀ ▀ ║ ▒▒
  73. │  ════════════════════════════  └────────┘  │ ▀▄▄▀▄▒▒▄║ 516-462-5287    ║ ▒▒
  74. └─────▄▄─────────────────────────────▄▄──────┘      ▒▒ ╚══╦═══════════╦══╝ ▒▒
  75.  
  76.  
  77.  
  78. ┌────────────────────────┐
  79. │ MOTIVATION FOR PROGRAM │
  80. └────────────────────────┘
  81.  
  82.  Having a facination for graphics programming I decided to explore image
  83.  processing.  I was quite interested in the area process convolution.  By
  84.  applying a small filter to an image you can get some very interesting or
  85.  some not so interesting results.  I have played with this program for hours
  86.  and have found it very enjoyable.  It is very interesting to try to
  87.  anticipate the result of the process or to apply the appropriate filter to
  88.  yield the desired result.  I'm sure this program will peak your interest as
  89.  it as done mine.
  90.  
  91. ┌───────────────────────────┐
  92. │ WHAT DOES THE PROGRAM DO? │
  93. └───────────────────────────┘
  94.  
  95.  The concept of convolution is the application of a filter to an image to
  96.  enhance specific aspects of it.  Convolution is an area process.  What I mean
  97.  by an area process is that each pixel in the resultant image is determined a
  98.  group of pixels in the original image.  Specifically this group of pixels is
  99.  a 3x3 filter that gets applied to our original image.  Each of the filters
  100.  provided has a certain mathematical significance.  Alot of complex
  101.  mathematics went into there design.  I have included 22 filters for you to
  102.  use.  Each of the filters is in a .TXT file.  In addition, you can create
  103.  your own filters to test and experiment with.
  104.  
  105.  
  106. ┌───────────────────────────────────────────┐
  107. │ FILTERS TO BE USED FOR IMAGE MODIFICATION │
  108. └───────────────────────────────────────────┘
  109.  
  110.  The filters you can use to modify an image are the following:
  111.  
  112.  Low-Pass Spatial Filters     Purpose of Filters
  113.  
  114.  LWPAS19.TXT  -  LOWPASS 1    Low-pass filters leave the low-frequency
  115.  LWPAS10.TXT  -  LOWPASS 2    content of an image intact while attenuating
  116.  LWPAS486.TXT -  LOWPASS 3    the high-frequency content.  Low-pass filters
  117.                               are good at reducing the visual noise contained
  118.                               in an image.  Noise is garbage found in image
  119.                               that does not pertain to image.  Low frequency
  120.                               areas in an image is where the color of the
  121.                               pixels vary slowly or remains constant.  You
  122.                               are required to use RCONVOLV to use these
  123.                               filters since they are composed of real numbers.
  124.  
  125.  High-Pass Spatial Filters    High-pass filters accentuate the high-
  126.                               frequency details of an image while leaving
  127.  HP191.TXT    -  HIGHPASS 1   the low-frequency content intact.  High-pass
  128.  HP150.TXT    -  HIGHPASS 2   filtering is used whenever objects with high
  129.  HP125.TXT    -  HIGHPASS 3   spacial-frequency content need to be examined.
  130.                               The higher-frequency portions of an image will
  131.                               be highlighted while the lower-frequency
  132.                               portions become black.  The use of High-pass
  133.                               filters may highlight images at the expense
  134.                               of adding noise to the image.  High frequency
  135.                               in images can be found by looking at edges of
  136.                               objects.  Edge enhancement of an image is
  137.                               possible with the use of High-pass filtering.
  138.  
  139.  Edge Enhancement Filters
  140.  
  141.  Edge enhancement filters reduce an image to just edges.  The brightness
  142.  of an edge after enhancement is proportional to the change in brightness
  143.  surrounding the edge in the original image.  Edge enhancement is mainly used
  144.  for machine vision.  It is can also be used as an artistic tool to produce
  145.  striking outlined images.
  146.  
  147.  Laplacian Edge Enhancement    Laplacian edge enhancement differs from the
  148.                                other enhancement methods since it is omni-
  149.  LAP1.TXT     - LAPLACIAN 1    directional.  It highlights edges regardless
  150.  LAP2.TXT     - LAPLACIAN 2    of direction.  Laplacian edge enhancements
  151.  LAP3.TXT     - LAPLACIAN 3    generate sharper edge definition than do
  152.  LAP4.TXT     - LAPLACIAN 4    most other enhancment operation.  Additionally,
  153.                                it highlights edges having both positive and
  154.                                negative brightness slopes.  All regions in the
  155.                                image which illustrate a rapid change will be
  156.                                accentuated and non-varing regions attenuated.
  157.  
  158.  Shift and Difference Edge     As the name implies, these filters enhance
  159.  Enhancement                   image edges by shifting an image pixel and
  160.                                then substracting the shifted image from the
  161.  SDVEDGE.TXT  - VERT. EDGE     original.  The result of the substraction is
  162.  SDHEDGE.TXT  - HORZ. EDGE     a measure of the slope of the brightness trend.
  163.  SDHVEDGE.TXT - VERT/HORZ EDGE In an area of constant pixel intensity, the
  164.                                substraction will yield a slope of zero.  Zero
  165.                                results in black pixel values.  In an area
  166.                                with large changes in intensity, an edge, for
  167.                                example, the subtraction will yield a large
  168.                                value for the slope, which will become a light
  169.                                colored pixel.  The larger the difference in
  170.                                intensities, the lighter the pixel.
  171.  
  172.  Gradient Directional Edge     Using Gradient edge detectors allows you
  173.  Enhancement                   to specify a direction for the edges other
  174.                                than just horizontal or vertical.  Diagonal
  175.  GRADNORT.TXT - NORTH          edges can be specified as well.  This is
  176.  GRADNE.TXT   - NORTHEAST      accomplished by using directions to indicate
  177.  GRADSOUT.TXT - SOUTH          the exact direction of the edges desired.
  178.  GRADSE.TXT   - SOUTHEAST      If a positive slope in the direction of the
  179.  GRADWEST     - WEST           filter exists, a light-colored pixel will be
  180.  GRADSW.TXT   - SOUTHWEST      placed in the resultant image.  For example
  181.  GRADNW.TXT   - NORTHWEST      if the East Kernal is used, a light-colored
  182.  GRADEAST.TXT - EAST           pixel will be placed in the output image if
  183.                                there is a transition from black to white in
  184.                                the east (left to right) direction of image.
  185.                                Constant regions will be attenuated while
  186.                                regions of high frequency change will be
  187.                                accentuated.
  188.  
  189.  Blurring Filter               The purpose of this filter is to blurr the
  190.                                image.
  191.  BLUR.TXT
  192.  
  193. ┌─────────────────────────────────┐
  194. │ FILES INCLUDED WITH THE PROGRAM │
  195. └─────────────────────────────────┘
  196.  
  197.  There are 31 files that should have been included with the archive file that
  198.  you received:
  199.  
  200.  RCONVOLV.EXE - Convolution Program for Low-Pass Filters Only - Real Numbers
  201.  ICONVOLV.EXE - Convolution Program for All Filter Except Low-Pass - Int #'s
  202.  CONVOLVE.DOC - Program Documentation - The File you are reading Now.
  203.  DEMO.BAT     - Demo's the Convolution Program and Illustrates Switches
  204.  
  205.  BLUR.TXT     - The Blurring Filter
  206.  GRADEAST.TXT - The Gradient East Filter
  207.  GRADNE.TXT   - The Gradient North East Filter
  208.  GRADNORT.TXT - The Gradient North Filter
  209.  GRADNW.TXT   - The Gradient Northwest Filter
  210.  GRADSE.TXT   - The Gradient Southeast Filter
  211.  GRADSOUT.TXT - The Gradient South Filter
  212.  GRADSW.TXT   - The Gradient Southwest Filter
  213.  GRADWEST.TXT - The Gradient West Filter
  214.  HP125.TXT    - High-pass Filter
  215.  HP150.TXT    - High-pass Filter
  216.  HP191.TXT    - High-pass Filter
  217.  LAP1.TXT     - Laplacian Filter
  218.  LAP2.TXT     - Laplacian Filter
  219.  LAP3.TXT     - Laplacian Filter
  220.  LAP4.TXT     - Laplacian Filter
  221.  LWPAS10.TXT  - Low-pass Filter
  222.  LWPAS19.TXT  - Low-pass Filter
  223.  LWPAS486.TXT - Low-pass Filter
  224.  SDHEDGE.TXT  - Shift & Difference Horizontal Edge Filter
  225.  SDHVEDGE.TXT - Shift & Difference Horizontal & Vertical Edge Filter
  226.  SDVEDGE.TXT  - Shift & Difference Vertical Edge Filter
  227.  
  228.  BANANA.PCX   - An XXX-Rated Black & White Picture - Great with Edge Detectors
  229.  BVISTA.PCX   - A Picture of Trees that Illustrates Many Gray-Levels
  230.  CLOWN.PCX    - A Close-up of a Clown Face
  231.  ROSE.PCX     - A Lovely Picture of an Open Rose
  232.  
  233.  
  234.  The only requirement is that the appropriate filter, image and program you
  235.  are using reside in the same directory.  Also if you wish to create .PCX
  236.  files of the resultant image, there must be space on the disk for it.
  237.  
  238. ┌─────────────────────┐
  239. │ RUNNING THE PROGRAM │
  240. └─────────────────────┘
  241.  
  242.  To run this program you type either ICONVOLV or RCONVOLV with the appropriate
  243.  parameters.  All Low-pass filters require the use of RCONVOLV because the
  244.  filters contain real numbers.  ICONVOLV is for all integer filters.  If you
  245.  have a choice wether to use ICONVOLV or RCONVOLV, use ICONVOLV since it is
  246.  much faster!
  247.  
  248.  To dive right in lets look at the demo that has been provided.  You can run
  249.  the demonstration of the program by entering DEMO.BAT at the DOS command
  250.  line.
  251.  
  252.  ICONVOLV HP191.TXT BVISTA.PCX -D NEWVISTA.PCX -S 1
  253.  
  254.  This example illustrates that you are using a High-pass filter on the
  255.  BVISTA.PCX image that was provided on the diskette.  The resultant image of
  256.  the processing will be stored using the -D switch in a file called
  257.  NEWVISTA.PCX.  The -S Switch is the scale factor.  If it appears that there
  258.  is too much color in your image, or you wish to obtain a different effect,
  259.  you can apply a scale filter.  In the example above a scale factor of 1 was
  260.  used.
  261.  
  262.  Both saving the resultant image and the scale factor are optional.  You can
  263.  simply type the following if you do not wish to save the result and scale
  264.  the image.
  265.  
  266.  ICONVOLV HP191.TXT BVISTA.PCX
  267.  
  268.  
  269.  Some examples for you to try:
  270.  
  271.  
  272.  ICONVOLV BLUR.TXT BVISTA.PCX -S 2    - This will blur image,
  273.                                         try other scale factors also.
  274.  
  275.  ICONVOLV LAP1.TXT CLOWN.PCX -S 1     - This will extract edges of image
  276.                                         in all directions.  Again try to
  277.                                         adjust scale factor.
  278.  
  279.  ICONVOLV LAP2.TXT BANANA.PCX         - Look at Those Edges, forget the
  280.                                         XXX Ratings of this picture.
  281.  
  282.  RCONVOLV LWPAS10.TXT ROSE.PCX        - Brings out the low frequencies and
  283.                                         attenuates the high frequencies
  284.  
  285. ┌─────────────────────────────────┐
  286. │ FUTURE OF THE CONVOLVE PROGRAM  │
  287. └─────────────────────────────────┘
  288.  
  289.  I see a need to localize the Convolution to a specific region on the screen.
  290.  For example instead of convoluting the entire image with a filter, you may
  291.  wish to only convolute part of it.  We expect this to be one of the
  292.  additions in our next release.
  293.  
  294.  We also are thinking of creating many image processing utilities so you can
  295.  have a digital darkroom at your disposal.
  296.  
  297. ┌──────────────────────────┐
  298. │ REGISTERING YOUR PROGRAM │
  299. └──────────────────────────┘
  300.  
  301.  Registering your program entitles you to be mailed the next FREE UPGRADE of
  302.  our program when it becomes available.
  303.  
  304.  Complete the order form below and send a check or moneyorder for $15.00
  305.  payable to: John Sirabella
  306.  
  307.  Mail it to the following address:
  308.  
  309.                              The Game Peddler BBS
  310.                              P.O. Box 159
  311.                              Commack, NY 11725
  312.  
  313.  If you come across any interesting 320x200x256 .GIF or .PCX Files that are
  314.  of excellent quality, please send them to us!
  315.  
  316.  
  317.   --------------------------------------------------------------------------
  318.   |                    CONVOLVE PROGRAM REGISTRATION FORM                  |
  319.   |                                                                        |
  320.   |                                                                        |
  321.   |  NAME________________________________________________________________  |
  322.   |                                                                        |
  323.   |  ADDRESS_____________________________________________________________  |
  324.   |                                                                        |
  325.   |  TOWN________________________ STATE______________ ZIP________________  |
  326.   |                                                                        |
  327.   |  PHONE_______________________________________________________________  |
  328.   |                                                                        |
  329.   |  WHERE DID YOU DOWNLOAD THIS PROGRAM FROM:___________________________  |
  330.   |                                                                        |
  331.   |  WHAT DO YOU LIKE ABOUT THIS PROGRAM:________________________________  |
  332.   |                                                                        |
  333.   |  ____________________________________________________________________  |
  334.   |                                                                        |
  335.   |  ____________________________________________________________________  |
  336.   |                                                                        |
  337.   |  WHAT DO YOU DISLIKE ABOUT THIS PROGRAM:_____________________________  |
  338.   |                                                                        |
  339.   |  ____________________________________________________________________  |
  340.   |                                                                        |
  341.   |  ____________________________________________________________________  |
  342.   |                                                                        |
  343.   |                                                                        |
  344.   |  HOW CAN THIS PROGRAM BE IMPROVED?___________________________________  |
  345.   |                                                                        |
  346.   |  ____________________________________________________________________  |
  347.   |                                                                        |
  348.   |  ____________________________________________________________________  |
  349.   |                                                                        |
  350.   |                                                                        |
  351.   |  *** PROGRAM AGREEMENT ***                                             |
  352.   |                                                                        |
  353.   |  You use this program solely at your own risk.  I John Sirabella make  |
  354.   |  NO promises, guarantees or warranties about the use of this program.  |
  355.   |  You use this program and any results that you obtain from it entirely |
  356.   |  at your own risk.                                                     |
  357.   |                                                                        |
  358.   |                                                                        |
  359.   |  I, ____________________________ understand and agree to all of the    |
  360.   |  limitations stated above.                                             |
  361.   |________________________________________________________________________|
  362.  
  363.  
  364.  
  365.   ▒▒▒ ▒  ▒ ▒▒   ▒▒▒▒ ▒▒▒▒ ▒▒ ▒▒ ▒▒▒   ▒▒▒▒  ▒▒▒ ▒▒▒  ▒▒▒  ▒    ▒▒▒ ▒▒▒     ▒▒
  366.    ▒  ▒▒▒▒ ▒■   ▒  ▄ ▒▄▄▒ ▒ ▒ ▒ ▒■    ▒▄▄▄▒ ▒■  ▒  ▒ ▒  ▒ ▒    ▒■  ▒▄▄▒    ▒▒
  367.    ▒  ▒  ▒ ▒▒   ▒▒▒▒ ▒  ▒ ▒   ▒ ▒▒▒   ▒     ▒▒▒ ▒▒▒  ▒▒▒  ▒▒▒  ▒▒▒ ▒   ▒   ▄▄
  368.  
  369.        Here is a listing of our software that we have created to date:
  370.  
  371.  
  372.  Tic-Tac-Toe  -  A Very Nice Text based Tic-Tac-Toe Game.  This game offers
  373.  TICTAC2.ZIP     a nice assortment of colors and graphics and it fills the
  374.                  entire screen.  A simple game yet I have never seen one such
  375.                  as this.
  376.  
  377.  5-Card Casino - A Nice 5-Card Casino Poker Game.  It is also text-based and
  378.  CARDCAS.ZIP     offer nice colors and graphics and sound.  Our rendition
  379.                  of the game of poker.
  380.  
  381.  Numerical     - Provides you with a way to evulate your ideas and strategies
  382.  Match           about number matching games.  Good for lottery games.
  383.  Analysis
  384.  MANALSIS.ZIP
  385.  
  386.  Convolve      - Our latest release, performs the image processing operation
  387.  CONVOLVE.ZIP    convolution on an image.  Great for image enhancement and
  388.                  special effects.